
package com.market.web.action;

import org.springframework.beans.BeanUtils;

import com.market.bean.Message;
import com.market.web.form.MessageForm;

public class AdminMsgEditAction extends MessageAction
{
    public String execute() throws Exception
    {
        int id = (int)getLong("id");
        Message msg = getMessageService().findById(id);
        MessageForm msgf = new MessageForm();
        if (msg != null)
        {
            BeanUtils.copyProperties(msg, msgf);
            msgf.setCate(findCatetory(msgf.getCategory()));
        }
        getRequest().setAttribute("messageForm", msgf);
        return SUCCESS;
        //return mapping.findForward("msgAdd");
    }
}
